<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
    <meta charset="utf-8">


    <link href="/assets/css/all.css" rel="stylesheet" type="text/css">
    <script async src="/assets/js/all.js"></script>


    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({tex2jax: {inlineMath: [['«', '»']]}});
      MathJax.Hub.config.tex2jax.skipTags = ["script", "noscript", "style", "textarea", "annotation", "annotation-xml"];

    </script>
    <script async src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS_HTML'></script>
    <!-- Google Analytics -->
    <script>
        window.ga = window.ga || function () {
            (ga.q = ga.q || []).push(arguments)
        };
        ga.l = +new Date;
        ga('create', 'UA-58002512-1', 'auto');
        ga('set', 'anonymizeIp', true);
        ga('send', 'pageview');
    </script>
    <script async src='https://www.google-analytics.com/analytics.js'></script>
    <!-- End Google Analytics -->

    <title>Nim by Example - Getting Started</title>

    <meta content="nanoc 4.9.9" name="generator">
    <meta content="colorful" http-equiv="Default-Style">
    <meta content="width=device-width, initial-scale=1" name=viewport>
</head>
<body>

<div id="sidebar">
    <div class="abs-hamburger">
        <div class="nav-toggle" onclick="sidebarClick();"><span></span></div>
    </div>
    <nav>
        <ul>
            <li><a href="/getting_started/">Getting Started</a></li>
            <li><a href="/hello_world/">Hello World</a></li>
            <li><a href="/comments/">Comments</a></li>
            <li><a href="/variables/">Variables</a>
                <ul>
                    <li><a href="/variables/result/">Result</a></li>
                    <li><a href="/variables/type_casting_inference/">Type Casting and Inference</a></li>
                </ul>
            </li>
            <li><a href="/if_else_while/">If, Else, While</a></li>
            <li><a href="/case/">Case Statements</a></li>
            <li><a href="/for_iterators/">For Loops &amp; Iterators</a></li>
            <li><a href="/procs/">Procs</a></li>
            <li><a href="/procvars/">First Class Functions</a></li>
            <li><a href="/block/">Blocks</a></li>
            <li><a href="/primitives/">Primitive Types</a></li>
            <li><a href="/types/">Type Aliases</a></li>
            <li><a href="/types/objects/">Object Types</a></li>
            <li><a href="/types/enums/">Enum Types</a></li>
            <li><a href="/types/distinct/">Distinct Types</a></li>
            <li><a href="/strings/">Strings</a></li>
            <li><a href="/arrays/">Arrays</a></li>
            <li><a href="/seqs/">Seqs</a></li>
            <li><a href="/bitsets/">Bitsets</a></li>
            <li><a href="/files/">Files</a></li>
            <li><a href="/json/">JSON</a></li>
            <li><a href="/varargs/">Varargs</a></li>
            <li><a href="/oop/">Object Oriented Programming</a></li>
            <li><a href="/macros/">Macros</a></li>
        </ul>


    </nav>
</div>

<article>
    <h1 id="getting-started">Getting Started</h1>
    <p>When installing Nim, you have two options: downloading a copy directly from git, or downloading a prepackaged
        distribution from the website</p>

    <h2 id="downloading-a-nim-distribution">Downloading a Nim Distribution</h2>
    <p>To get started with Nim, head over to the <a href="http://nim-lang.org/download.html">downloads page</a> and
        download the version you’d like.</p>

    <p>The Windows distribution comes with the MinGW compiler, which is recommended, but if you’d like to use your own
        compiler, download the version without MinGW. If you get an error like <code>Error: unhandled exception: The
            system cannot find the file specified.</code>, then make sure that the C compiler is on your path.</p>

    <p>On Mac and Linux, it is recommended to use either GCC or Clang.</p>

    <p>Once you have downloaded the appropriate distribution and extracted the files somewhere convenient, feel free to
        place the <code>bin</code> directory in the path for easier access.</p>

    <h2 id="downloading-from-git">Downloading from Git</h2>
    <p>To install Nim from git, ensure that you have gcc installed on Windows, Linux, and BSDs and clang on Mac.
        Afterwards, run the following series of commands to download and bootstrap Nim:</p>

    <pre><code class="language-console"><span class="gp">$</span> git clone -b master git://github.com/Araq/Nim.git
<span class="gp">$</span> <span class="nb">cd</span> Nim
<span class="gp">$</span> git clone --depth <span class="m">1</span> git://github.com/nim-lang/csources
<span class="gp">$</span> <span class="nb">cd</span> csources
<span class="gp">$</span> sh build.sh <span class="c1"># Replace with build.bat on windows</span>
<span class="gp">$</span> <span class="nb">cd</span> ..
<span class="gp">$</span> bin/nim c koch
<span class="gp">$</span> ./koch boot -d:release</code></pre>

    <p>Once compiled, you may want to add the <code>bin</code> directory to your path for easy access.</p>

</article>

<div id=nextprev>
    <a class="text-icon disabled" href="https://please-enable-js/" id=arrow-prev>↽</a>
    <a class="text-icon disabled" href="https://please-enable-js/" id=arrow-next>⇁</a>
</div>

<footer>
    <li><a href="https://github.com/flaviut/nim-by-example">Contribute</a></li>
    <li
    ><a href="#" onclick="toggleDarkMode(); return false;">Toggle dark mode</a></li>

</footer>
</body>
</html>
